package com.supor.aiot.food.view;

import android.content.Context;
import android.graphics.Rect;
import android.util.Log;
import android.view.View;

import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;

import com.supor.aiot.food.R;

public class GrideItemDecoration extends RecyclerView.ItemDecoration {

    private Context mContext;

    public GrideItemDecoration(Context mContext) {
        this.mContext = mContext;
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        if (parent.getChildAdapterPosition(view)==0){
            outRect.left = mContext.getResources().getDimensionPixelSize(R.dimen.dp_10);
        }
    }
}
